<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<script src="../../js/KISCore.js"></script>
<body>
	<script src="KISCompress.js"></script>
	<script>
		var js = null;
		function compress(){
			js = js ||new kiscompress.JSScript();
			var script = document.getElementById("content").value;
			var output = js.compress(script);
			document.getElementById("output").value = output;
			document.getElementById("info").innerText = script.length+"=>"+output.length;
		}
		function removeCommand(){
			js = js ||new kiscompress.JSScript();
			var script = document.getElementById("content").value;
			var output = js.onlyDeleteCommandString(script);
			document.getElementById("output").value = output;
			document.getElementById("info").innerText = script.length+"=>"+output.length;
		}
		
		function run(){
			var script = document.getElementById("output").value;
			eval(script);
		}
	</script>
	<textarea id="content" style="width:500px;height:400px" onkeydown="document.getElementById('info').innerText =''"></textarea>
	<div style="display:inline-block">
		<div id="info"></div>
		<div><input type="button" style="width:160px;height:30px" onclick="compress()" value="压缩=>" /></div>
		<div><input type="button" style="width:160px;height:30px" onclick="removeCommand()" value="去掉注释字符" /></div>
		<div><input type="button" style="width:160px;height:30px" onclick="run()" value="运行压缩后的代码" /></div>
	</div>
	<textarea id="output" style="width:500px;height:400px"></textarea>
	
</body>